package com.kongjs.application.convert;

import com.kongjs.application.model.dto.QueryGroupDTO;
import com.kongjs.application.model.dto.QueryGroupParamDTO;
import com.kongjs.application.model.dto.SaveGroupDTO;
import com.kongjs.application.model.dto.UpdateGroupDTO;
import com.kongjs.application.model.entity.Groups;
import com.kongjs.application.model.vo.QueryGroupParamVO;
import com.kongjs.application.model.vo.QueryGroupVO;
import com.kongjs.application.model.vo.SaveGroupVO;
import com.kongjs.application.model.vo.UpdateGroupVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

import java.util.List;

@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE,unmappedSourcePolicy = ReportingPolicy.IGNORE)
public interface GroupsConverter {
    SaveGroupDTO toDto(SaveGroupVO vo);
    UpdateGroupDTO toDto(UpdateGroupVO vo);
    QueryGroupDTO toDto(Groups groups);
    List<QueryGroupDTO> toDtos(List<Groups> groups);
    List<QueryGroupVO> toVos(List<QueryGroupDTO> dtos);
    QueryGroupParamDTO toDto(QueryGroupParamVO vo);
    @Mapping(target = "id",ignore = true)
    Groups toEntity(SaveGroupDTO dto);
    Groups toEntity(UpdateGroupDTO dto);
    QueryGroupVO toVo(QueryGroupDTO dto);
}
